<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>修改密码 modifyPaw.html</title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />
	<link rel="stylesheet" href="../css/less/common_less.css" />
	<style>
		.newPlan{
			background:#ff7777;
		}
		.btnBox{
			width:1050px;
			text-align:center;
			margin-top:15px;
		}
		.addAir{
			width:1000px;
			margin-top:50px;
		}
		.addAir p{
		  	margin:0 auto;  
			color:#959ca2;
			width:350px;
			height:30px;
			margin-top:15px;
			line-height:30px;
			text-align:right;
		}
		.addAir p input{
			width:200px;
			height:100%;
			margin-left:10px;
			font-family:"微软雅黑";
			font-size:14px;
			padding-left:10px;
			
		}
		.sure{
			width:100px;
		}
	</style>
	<body>
		<div class="addAir">
			<p>当前登录密码:<input class='passwordNow' type="text" /></p>
			<p>新的登录密码:<input class='passwordNew' type="password"  /></p>
			<p>确认新的登录密码:<input class='passwordNew_' type="password"  /></p>
		</div>
		
		<div class='btnBox'>
			<button class='Dolo_btn sure'>确认</button>
			
		</div>
		
		
	</body>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>					
		<script>
			$(".sure").click(function(){
				if($(".passwordNow").val()==""){
					layer.msg("当前密码不能为空！",{icon: 2,time:2000})
					return false;
				}				
				if($(".passwordNew").val()==""){
					layer.msg("新密码不能为空！",{icon: 2,time:2000})
					return false;
				}				
				if($(".passwordNew_").val()==""){
					layer.msg("确认密码不能为空！",{icon: 2,time:2000})
					return false;
				}				
				if($(".passwordNew").val()!=$(".passwordNew_").val()){
					layer.msg("确认密码有误！",{icon: 2,time:2000})
					return false;
				}
				
				var submitMess = {};
				submitMess.oldPwd = $(".passwordNow").val();
				submitMess.pwd = $(".passwordNew").val();	
				layer.msg('修改中...', {icon: 16,shade: 0.01});
				$.ajax({
					type:"post",
					url:"../User/editpasswd?temp="+Math.random(),
					contentType:'application/json;charset=utf-8',
					async:true,
					data:JSON.stringify(submitMess),
					success:function(data){
						data=JSON.parse(data)
						if(data.status=="1001"){
							layer.msg('修改密码成功', {icon: 1,time:1000},function(){
								
							})	
						}if(data.status=="1002"){
							layer.msg("修改密码失败,"+data.message,{icon: 2,time:2000},function(){
								
							})
						}
					}					
				});													
			})	
			
			
		</script>
		
			
</html>
